import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/auth/login',
    method: 'post',
    data
  })
}

export function updatePassword(data) {
  return request({
    url: '/user/auth',
    method: 'patch',
    data
  })
}

export function getUserInfo(username) {
  return request({
    url: `/user/${username}`,
    method: 'get'
  })
}

export function logout(username) {
  return request({
    url: `/user/auth/${username}`,
    method: 'get'
  })
}

export function listByUserId(userId) {
  return request({
    url: `/user-role-relation/${userId}`,
    method: 'get'
  })
}
